import JSEncrypt from 'jsencrypt'
import Encrypt from 'encryptlong'


const publicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJXjjN54zuYgR9Xl/VxQu63X9PgrCENf8C9j7WcyB/+f8cy3zQmIW3h0/auw1oKrcxeNz8rctaFsBiNI7BZlTuMCAwEAAQ==";

export default {
// 使用JSEncrypt进行加密
rsaPublicData(data) {
const jsencrypt = new JSEncrypt()
jsencrypt.setPublicKey(publicKey)
const result = jsencrypt.encrypt(data)
return result
},

// 使用encryptlong进行长文本加密
encrypt(data) {
const encryptor = new Encrypt()
encryptor.setPublicKey(publicKey)
const result = encryptor.encryptLong(data)
return result
}
}